package com.earth.amazeadmin.config.mvc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.*;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.templatemode.TemplateMode;
import org.thymeleaf.templateresolver.ITemplateResolver;

/**
 * Created by dongjigong on 2018/5/8.
 *
 * @Email osbornjonny@126.com
 * @Description
 */
@Configuration
@EnableWebMvc
public class CustomerWebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/").setCachePeriod(31556926);
        registry.addResourceHandler("/public/**").addResourceLocations("classpath:/public/").setCachePeriod(31556926);
    }

    /**
     * 对dc的拦截控制
     *
     * @param registry
     */
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//
//
////        registry.addInterceptor(customerIntercepter).addPathPatterns("/qam/main");
////        registry.addInterceptor(customerWapIntercepter).addPathPatterns("/wap/**");
////        registry.addInterceptor(customerWapIntercepter).addPathPatterns("/api/**");
//        super.addInterceptors(registry);
//    }

}

